
<script type="text/javascript">
    $(document).ready(function() { 
        $('#subButton').click(function(){  
            // alert("asdfasdf");
            // $(window.frames["showview"].document).html("asdfasdfasdfd");
            window.frames["showview"].document.write('开始统计数据，请稍等...');
            if($('#day').val()==""){
                $('#showview').attr('src',"<?php echo Yii::app()->createUrl('stats/count')?>");
            }else{ 
                $('#showview').attr('src',"<?php echo Yii::app()->createUrl('stats/count&day=')?>"+$('#day').val());
            }  
            $('#showview').load();
            $('#subButton').css('background','#eee');
            $('#subButton').attr('disabled',true);
            return false;
        });
    });
    function resetButton(){
        $('#subButton').css('background','');
        $('#subButton').attr('disabled',false);
    }
</script>
 
<h1>手动统计</h1> 

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'countadmin-form', 
    'enableAjaxValidation'=>false, 
)); ?>  
 
    <div class="row">
        <?php echo CHtml::label("统计天数",false);  ?>
        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'id'=>'day',
            'name'=>'day',
            'language'=>'zh',
            'options'=>array(
                'maxDate'=>'new Date()',  
                'dateFormat'=>'yy-mm-dd',
                'showAnim'=>'fold',
            ),
            //'value'=>date('Y-m-d', strtotime(date("Y-m-d")." - 1 day")),
            'htmlOptions'=>array(
                'style'=>'height:20px;'
            ),
        )); ?> 
    </div> 
    <div class="row buttons">
        <?php echo CHtml::button('开始统计',array('class'=>'subButton','id'=>'subButton')); ?>
    </div>

<?php $this->endWidget(); ?>
  <iframe src="" width="100%" height="200px" frameborder='0' id="showview" name="showview"></iframe>
</div><!-- form -->
